package com.codejam.logback.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;


@RestController
@RequestMapping("test")
public class TestController {

    Logger logger = LoggerFactory.getLogger(TestController.class);

    @GetMapping("/test1")
    public String test1() {

        //日志级别 trace<debug<info<warn<error<fatal
        logger.trace("trace ImportDemoController 开始>>>");
        logger.debug("debug ImportDemoController 开始>>>");
        logger.info("info ImportDemoController 开始>>>");
        logger.warn("warn ImportDemoController 开始>>>");
        logger.error("error ImportDemoController 开始>>>");


        return new Date().toString();
    }
}
